
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>{{ mission_approval.name }}</title>

    <!-- Bootstrap core CSS -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="{{ url_for('static',filename='css/mission_approval.css',_external=True) }}" rel="stylesheet">


  </head>

  <body>

    <!-- Begin page content -->
    <div class="container">
      <div class="page-header">
        <h1>{{ mission_approval.name }}</h1>



      </div>
      <p>任务类型：{{ mission_approval.mission_type }}</p>
      <p>投标截止日期：{{ mission_approval.deadline }}</p>
      <p class="lead">任务描述：{{ mission_approval.description }}</p>
      <p class="lead">任务目标：{{ mission_approval.obj }}</p>
      <p class="lead">技能需求：</p>
      {% if mission_approval.skill_need %}
        {% for skill in mission_approval.skill_need %}
          <p>{{ skill }}</p>
        {% endfor %}
        {% else %}
          <p>无要求</p>
      {% endif %}
      <p class="lead">酬金：{{ mission_approval.bounty }}</p>
      <p class="lead">状态：{{ mission_approval.state }}</p>
      <p class="lead">发布者：{{ mission_approval.publisher }}</p>

      <p>
        <button type="button" class="btn btn-primary btn-lg" id="pass">通过</button>
        <button type="button" class="btn btn-default btn-lg" id="deny">驳回</button>
      </p>
      <p>Use <a href="../sticky-footer-navbar">the sticky footer with a fixed navbar</a> if need be, too.</p>
    </div>

    <footer class="footer">
      <div class="container">
        <p class="text-muted">Place sticky footer content here.</p>
      </div>
    </footer>

  </body>
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$('#pass').click(function(){
  $.ajax({
        url:"/admin/{{ mission_approval.mission_id }}",
        data:{'code':'pass'},
        type:"POST",
        // dataType:"json",
        success:function(result){
            alert('该申请已通过');
            top.window.location.href = "/admin/approval";
            // setTimeout("window.opener=null;window.open('','_self');window.close();",500)
            },
        error:function(){
            alert("error")
        }
    })
  });

$('#deny').click(function(){
  $.ajax({
        url:"/admin/{{ mission_approval.mission_id }}",
        data:{'code':'deny'},
        type:"POST",
        // dataType:"json",
        success:function(result){
            alert('该申请已驳回');
            top.window.location.href = "/admin/approval";
            // setTimeout("window.opener=null;window.open('','_self');window.close();",500)
            },
        error:function(){
            alert("error")
        }
    })
  });


</script>

</html>
